<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>keyname</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_009_038">&nbsp;</a>NAME</h4><blockquote>
keyname, key_name - get name of key
</blockquote><h4><a name = "tag_001_009_039">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

char *keyname(int <i>c</i>);

char *key_name(wchar_t <i>c</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_001_009_040">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>keyname()</i>
and
<i>key_name()</i>
functions generate a character string whose value describes the key <i>c</i>.
The <i>c</i> argument of
<i>keyname()</i>
can be an 8-bit character or a key code.  The <i>c</i> argument of
<i>key_name()</i>
must be a wide character.
<p>
The string has a format according to the first applicable row in the
following table:
<p>
<p><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Input </b>
<th align=center><b>Format of Returned String</b>
<tr valign=top><td align=left>Visible character
<td align=left>The same character
<tr valign=top><td align=left>Control character
<td align=left>^<i>X</i>
<tr valign=top><td align=left>Meta-character (<i>keyname()</i> only)
<td align=left>M-<i>X</i>
<tr valign=top><td align=left>Key value defined in &lt;</i><b>curses.h</b><i>&gt; (<i>keyname()</i> only)
<td align=left>KEY_<i>name</i>
<tr valign=top><td align=left>None of the above
<td align=left>UNKNOWN KEY
</table>
<p>
The meta-character notation shown above is used only if meta-characters are
enabled.
</blockquote><h4><a name = "tag_001_009_041">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i>keyname()</i>
returns a pointer to a string as described above.  Otherwise, it returns
a null pointer.
</blockquote><h4><a name = "tag_001_009_042">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_001_009_043">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The return value of
<i>keyname()</i>
and
<i>key_name()</i>
may point to a static area which is overwritten by a subsequent call to
either of these functions.
<p>
Applications normally process meta-characters without storing them into a
window.  If an application stores meta-characters in a window and tries to
retrieve them as wide characters,
<i>keyname()</i>
cannot detect meta-characters, since wide characters do not support
meta-characters.
</blockquote><h4><a name = "tag_001_009_044">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="meta.html">meta()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
